package com.gm.mapper;

import com.gm.bean.Book;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.web.bind.annotation.DeleteMapping;

import java.util.List;

public interface BookMapper {
    @Select("select * from tb_book")
    List<Book> findBookAll(Integer page, Integer size);
    @Insert("insert into tb_book (bookname,author,press,bookuser) values(#{bookname},#{author},#{press},#{bookuser})")
    void AddBook(Book book);
    @Delete("delete from tb_book where bid=#{bid}")
    void delBook(Integer bid);
    @Select("select * from tb_book where bookname=#{bookname}")
    Book getBookByName(String bookname);
    @Update("update tb_book set bookname=#{bookname},author=#{author},press=#{press},bookuser=#{bookuser} where bid= #{bid}")
    void bookUpd(Book book);
}
